package com.iwhalecloud.bss.kite.cucc.web.service.accept.handler.attr;

import com.iwhalecloud.bss.kite.client.vo.scene.CommonAttrVO;
import com.iwhalecloud.bss.kite.web.service.accept.attr.handler.AbstractAttrHandler;
import com.ztesoft.bss.base.entity.StaticAttrDO;
import org.springframework.stereotype.Service;

@Service
public class DevPersonSendMessageHandler extends AbstractAttrHandler {

    @Override
    public void init(CommonAttrVO commonAttr) {
        //是否发送短信初始化为否
        String attrValuesDesc = commonAttr.getAttrValues().stream().filter(staticAttr -> {return staticAttr.getAttrValue().equals(commonAttr.getDefaultValue());})
            .map(StaticAttrDO::getAttrValueDesc).findFirst().orElse(null);
        commonAttr.setValue(commonAttr.getDefaultValue());
        commonAttr.setValueDesc(attrValuesDesc);
        setCommonAttr(commonAttr);
    }

}
